<?php

/**
 * Href property
 *
 * The href property represpents a url within a {DAV:}href element.
 * This is used by many WebDAV extensions, but not really within the WebDAV core spec
 * 
   * Copyright © 2010 Jack Cleaver
   * 
   * This plugin provides functionality added by CalDAV (RFC 4791)
   * It implements new reports, and the MKCALENDAR method.
   *
   * This file is part of Slash.
   *
   * Slash is free software: you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   *
   * Slash is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   *
   * You should have received a copy of the GNU General Public License
   * along with Slash.  If not, see <http://www.gnu.org/licenses/>.
 */
class Slash_ACL_Property_Href 
	extends Sabre_DAV_Property 
	implements Sabre_DAV_Property_IHref 
{

    private $href;

    public function __construct($href) 
    {
        $this->href = $href;
    }

    public function getHref() 
    {
        return $this->href;
    }

    public function serialize(Sabre_DAV_Server $server, DOMElement $hrefElement) 
    {
       $hrefElement->nodeValue = $this->href;
    }

    static function unserialize(DOMElement $dom) 
    {
	    return new self($dom->textContent);
    } 

}
